<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>camray: src/camera_array_depth.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">camray
   </div>
   <div id="projectbrief">Depth mapping algorithms using a camera array</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('camera__array__depth_8cpp.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">camera_array_depth.cpp File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Generates depth maps for image pairs and a combined depth map using the individual depth maps.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;camera_array_depth.h&quot;</code><br/>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a2df8acdfa726d44f99d6a31f9a981567"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2df8acdfa726d44f99d6a31f9a981567"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>generate_hybrid_image</b> (Mat &amp;depth, Mat &amp;orig_image, Mat &amp;hybrid_img, string output_dir)</td></tr>
<tr class="separator:a2df8acdfa726d44f99d6a31f9a981567"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af40d564acdef2d83c94284734fe6033b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="camera__array__depth_8cpp.html#af40d564acdef2d83c94284734fe6033b">compute_array_depth</a> (FileNode fs)</td></tr>
<tr class="separator:af40d564acdef2d83c94284734fe6033b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a83ad0fe0c5ee5e10c3584ab7d917c05f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="camera__array__depth_8cpp.html#a83ad0fe0c5ee5e10c3584ab7d917c05f">compute_diff_mat</a> (Mat matches, Mat &amp;diff_mat, bool x_change, bool y_change)</td></tr>
<tr class="separator:a83ad0fe0c5ee5e10c3584ab7d917c05f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a22f5418ac754b7ad540828369a85c595"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="camera__array__depth_8cpp.html#a22f5418ac754b7ad540828369a85c595">combine_depth_maps</a> (vector&lt; Mat &gt; matches, vector&lt; Mat &gt; diff_mats, Mat &amp;average_depth, int select_method)</td></tr>
<tr class="separator:a22f5418ac754b7ad540828369a85c595"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a55162c7a90b16569f7467dcecd65bbb0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="camera__array__depth_8cpp.html#a55162c7a90b16569f7467dcecd65bbb0">generate_color_maps</a> (vector&lt; Mat &gt; diff_mats, Mat &amp;average_depth, float base_line, float f_pixels, int max_search, string output_dir, const int pixel_radius)</td></tr>
<tr class="separator:a55162c7a90b16569f7467dcecd65bbb0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Generates depth maps for image pairs and a combined depth map using the individual depth maps. </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a22f5418ac754b7ad540828369a85c595"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void combine_depth_maps </td>
          <td>(</td>
          <td class="paramtype">vector&lt; Mat &gt;&#160;</td>
          <td class="paramname"><em>matches</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">vector&lt; Mat &gt;&#160;</td>
          <td class="paramname"><em>diff_mats</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Mat &amp;&#160;</td>
          <td class="paramname"><em>average_depth</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>select_method</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section author"><dt>Author</dt><dd>Brian Fehrman</dd></dl>
<dl class="section user"><dt>Description: Computes the disparity between matching points. It will only</dt><dd>consider the distance along the main camera offset. For diagonal pairs, it will account for both directions and then scale the result by 1/sqrt(2).</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">matches</td><td>- Contains the matching information for all camera pairs, the confidence information from this is needed </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">diff_mats</td><td>- The disparities found for all camera pairs </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">average_depth</td><td>- The combined depth map </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">select_method</td><td>- determines what to do when there is a large disagreement among the depth maps for a given pixel </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="af40d564acdef2d83c94284734fe6033b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void compute_array_depth </td>
          <td>(</td>
          <td class="paramtype">FileNode&#160;</td>
          <td class="paramname"><em>fs</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section author"><dt>Author</dt><dd>Brian Fehrman</dd></dl>
<dl class="section user"><dt>Description: Generates depth maps for a camera array. Using matching information</dt><dd>found for each pair of cameras and determines the distance between points across the two images. A depth map is generated for each camera pair. These individual depth maps are then combined in to a single depth map.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">fs</td><td>- FileNode pointing to the settings that are needed </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a83ad0fe0c5ee5e10c3584ab7d917c05f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void compute_diff_mat </td>
          <td>(</td>
          <td class="paramtype">Mat&#160;</td>
          <td class="paramname"><em>matches</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Mat &amp;&#160;</td>
          <td class="paramname"><em>diff_mat</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>x_change</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>y_change</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section author"><dt>Author</dt><dd>Brian Fehrman</dd></dl>
<dl class="section user"><dt>Description: Computes the disparity between matching points. It will only</dt><dd>consider the distance along the main camera offset. For diagonal pairs, it will account for both directions and then scale the result by 1/sqrt(2).</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">matches</td><td>- Contains the matching information for a camera pair </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">diff_mat</td><td>- stores the disparity between the images </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">x_change</td><td>- if the main camera offset was along the x direction </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">y_change</td><td>- if the main camera offset was along the y direction </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a55162c7a90b16569f7467dcecd65bbb0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void generate_color_maps </td>
          <td>(</td>
          <td class="paramtype">vector&lt; Mat &gt;&#160;</td>
          <td class="paramname"><em>diff_mats</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Mat &amp;&#160;</td>
          <td class="paramname"><em>average_depth</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>base_line</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>f_pixels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>max_search</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"><em>output_dir</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int&#160;</td>
          <td class="paramname"><em>pixel_radius</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section author"><dt>Author</dt><dd>Brian Fehrman and Scott Logan</dd></dl>
<dl class="section user"><dt>Description: Generates color depth maps based on the disparities found among camera pairs.</dt><dd>A scale with the estimated real world distance in mm is shown to the right of each depth map. Unknown depths are shown as a gray color.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">diff_mats</td><td>- The disparities found for all camera pairs </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">average_depth</td><td>- The combined depth map </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">base_line</td><td>- distance in mm between camera pairs (used to estimate true depth in mm) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">f_pixels</td><td>- approximate focal length of cameras in units of pixels </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">max_search</td><td>- the largest possible pixel displacement between images </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">output_dir</td><td>- where the colored depth maps should be saved </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">pixel_radius</td><td>- determines the size of the pixels that are drawn </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="camera__array__depth_8cpp.html">camera_array_depth.cpp</a></li>
    <li class="footer">Generated on Tue Apr 23 2013 23:15:47 for camray by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.3.1 </li>
  </ul>
</div>
</body>
</html>
